package week07.midTest;

import java.util.Random;

public class HelicopterProxy {
    private Helicopter helicopter=null;

    public HelicopterProxy(Helicopter helicopter) {
        this.helicopter = helicopter;
    }

    public void proxyLaunch(){
        Random random=new Random();
        if (random.nextBoolean()){
            this.helicopter.launch();
            System.out.println("通知直升机起飞");

        }else {
            System.out.println("飞机出现事故起飞失败");
        }
    }
}
